#ifndef INIT_C
#define INIT_C

void init_vm(int32_t memSize)
{
	RAM = (char*) malloc(memSize);
	ramSize = memSize;
	heapPointer = memSize;
	CallStack = (char*)malloc(1024);
	stackSegment = memSize - 10;
	stackPointer = 0;
	basePointer = memSize - 800;
	interrupt_handlers[1] = sysf_print;
	interrupt_handlers[2] = sysf_read;
	interrupt_handlers[3] = sysf_strcat;
	interrupt_handlers[4] = sysf_strcmp;
	interrupt_handlers[5] = sysf_toint;
	interrupt_handlers[6] = sysf_tostr;
	interrupt_handlers[7] = sysf_open;
	interrupt_handlers[8] = sysf_close;
	interrupt_handlers[9] = sysf_seek;
	interrupt_handlers[10] = sysf_seekcur;
	interrupt_handlers[11] = sysf_seekend;
	interrupt_handlers[12] = sysf_put;
	interrupt_handlers[13] = sysf_get;
	interrupt_handlers[14] = sysf_fota;
	faultRegions = (faultRegion*)malloc(sizeof(faultRegion));
}

#endif
